# Replication package for "The Economics of Orbit Use: Open Access, External Costs, and Runaway Debris Growth"

This repository contains datasets and code for the paper "The Economics of Orbit Use: Open Access, External Costs, and Runaway Debris Growth". A preprint version and previous drafts are available at [arXiv:2202.07442](https://arxiv.org/abs/2202.07442).

## Repository Structure

- **/data**: Contains calibration data and simulated output data.
  - **/calibration-data**: Contains CSV files for calibrated simulations, based on the analysis in Rao and Letizia (2021), accessible [here](https://arxiv.org/abs/2205.05205).
- **/images**: Contains figures generated from simulation scripts.
- **/bin**: Contains code for figure generation, calibration, and simulation execution.
- **simFnsEqns_1.0.tar.gz**: An R package with Rcpp model functions for enhanced computation.

## Installation and Setup

Analysis was conducted using R version 3.6 under Ubuntu 22.04 on a machine with dual Intel Xeon 6230 CPUs and 256 GB RAM. The `chebpol` R package was used for interpolation.

Install the `simFnsEqns` package from the root directory via: `R CMD INSTALL simFnsEqns_1.0.tar.gz`.

## Running Simulations

Appendices C and D of the paper provide insights into calibration and the algorithms for simulations. Footnote 17 in the main text describes the process of obtaining calibration scale factors for figures illustrating qualitative results.

## Code Files in /bin

The files prefixed with `figure-X` generate specific figures in the paper, while the other scripts provide helper functions.

### Runtimes and instructions

Figures 1-8 can be generated by `source()`ing the files in R or with `Rscript` from the command line.

- Figures 1-4 take seconds to minutes.
- Figures 5-7 involve the planner's problem and take around an hour.
- Figure 8 takes around 4 hours, and figure 9 takes around 2 hours.
- To generate figure 9, execute `figure-9.0--calibrated-simulations.sh`. This will call `figure-9.1--run-calibrated-simulation.r` several times with different inputs to generate simulation outputs, then `figure-9.2--generate-plots.r` to bring them together and create figure 9.

See R scripts for lists of packages needed to run them.

## Data Files

The `/data` directory includes essential input files for simulations as well as generated outputs. Due to size considerations, some generated files are omitted but calibrated simulation results from running figure 9 code are available for ease of replication.

## Licensing

This replication package is made available under the MIT License.

## Acknowledgments

This work was supported by funding from the University of Colorado Boulder.
